﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;
using System.Windows.Media;

namespace agile_tool
{
     public static class helper
    {

        public static UserControl FindParrentUserControl(DependencyObject child, string type)
        {
            try
            {
                DependencyObject parent = VisualTreeHelper.GetParent(child);
                if (parent.GetType().ToString() == type)
                    return (UserControl)parent;

                if (parent == null) return null;

                return FindParrentUserControl(parent, type);
            }
            catch { return null; }
        }


    }
 

}
